// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.dev5.controller;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import io.swagger.annotations.ApiOperation;
import com.orange.boot.utils.R;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import com.orange.boot.dev5.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import com.orange.boot.dev5.service.AdministratorService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/dev5"})
@Api(
        tags = {"管理员操作"}
)
public class AdministratorController {
    @Autowired
    private AdministratorService administratorService;

    public AdministratorController() {
    }

    @ApiOperation("修改用户权限")
    @PostMapping({"updatePermissions/{oldStatus}"})
    public R updatePermissions(@RequestBody User user, @PathVariable Integer oldStatus) {
        return this.administratorService.updatePermissions(user, oldStatus);
    }

    @ApiOperation("查询用户信息")
    @GetMapping({"getUser/{id}"})
    public R getUser(@PathVariable String id) {
        return this.administratorService.getUser(id);
    }

    @ApiOperation("逻辑删除用户")
    @DeleteMapping({"deleteUser/{id}"})
    public R removeUser(@PathVariable String id) {
        return this.administratorService.removeUser(id);
    }

    @ApiOperation("获取未通过审核的注册用户")
    @PostMapping({"getNotPassUser"})
    public R getNotPassUser() {
        return this.administratorService.getNotPassUser();
    }

    @ApiOperation("管理员审核用户注册")
    @PostMapping({"checkUser/{id}"})
    public R checkUser(@PathVariable("id") String id) {
        return this.administratorService.checkUser(id);
    }
}